#define _CRT_SECURE_NO_WARNINGS 1
class Solution {
public:
    string removeDuplicates(string s) {
        string ret;
        int cur = 0;
        while (cur < s.size())
        {
            if (ret.empty() || ret[ret.size() - 1] != s[cur]) ret.push_back(s[cur]);
            else ret.pop_back();
            cur++;
        }
        return ret;
    }
};